CHAPTER 1 ■ INTRODUCTION
2
Who Should Read This Book
Developers and architects who have prior experience in any web app stack other than the MERN stack will
find the book useful for learning about this modern stack. Prior knowledge of how web applications work is
required. Knowledge of JavaScript is also required. It is further assumed that the reader knows the basics of
HTML and CSS. It will greatly help if you are also familiar with the version control tool git; you could try out
the code just by cloning the git repository that holds all the source code described in this book and running
each step by checking out a branch.
The code in the book uses the latest features of JavaScript (ES2015+), and it is assumed that you well-
versed in these features such as classes, fat-arrow functions, const keyword, etc. Whenever I first use any of
these modern JavaScript features, I will point it out using a note so that you are aware that it is a new feature.
In case you are not familiar with a particular feature, you can read up on it as and when you encounter it.
If you have decided that your new app will use the MERN stack, then this book is a perfect enabler
for you that lets you quickly get off the ground. Even if you have not, reading the book will get you excited
about MERN and equip you with enough knowledge to make a choice for a future project. The most
important thing you will learn is to put together multiple technologies and build a complete, functional web
application, and you can be called a full-stack developer or architect on MERN.
Structure of the Book
Although the focus of the book is to let you learn how to build a complete web application, most of the book
revolves around React. That’s just because, as is true of most modern SPAs, the front-end code forms the
bulk. And in this case, React is used for the front-end.
The tone of the book is tutorial-like and designed for learning by doing. We will build a web application
during the course of the book. I use the term “we” because you will need to write code just as I show you the
code that is to be written as part of the plentiful code listings. Unless you write the code yourself alongside
me and solve the exercises, you will not get the full benefit of the book. I encourage you not to copy-paste;
instead please type out the code. I find this very valuable in the learning process. There are very small
nuances—e.g., types of quotes—that can cause a big difference. When you type out the code, you are much
more conscious of this than when you are just reading it.
Sometimes, you may run into situations where what you typed in doesn’t work. In such cases, you may
want to copy-paste to ensure that the code is correct and overcomes any typos you may have made. In such
cases, do not copy-paste from the electronic version of the book, as the typesetting may not be faithful to the
actual code. I have created a GitHub repository at https://github.com/vasansr/pro-mern-stack-2 for you
to compare, and in unavoidable circumstances, to copy-paste from.
I have also added a checkpoint (a git branch in fact) after every change that can be tested in isolation so
that you can look at the exact diffs between two checkpoints, online. The checkpoints and links to the diffs
are listed in the home page (the README) of the repository. You may find this more useful than looking at
the entire source, or even the listings in the text of this book, as GitHub diffs are far more expressive than
what I can show in print.
Rather than cover one topic or technology per section, I have adopted a more practical and problem-
solving approach. We will have developed a full-fledged working application by the end of the book, but we’ll
start small with a Hello World example. Just as in a real project, we will add more features to the application
as we progress. When we do this, we’ll encounter tasks that need additional concepts or knowledge to
proceed. For each of these, I will introduce the concept or technology that can be used, and I’ll discuss that
in detail.
Thus, you may not find every chapter or section devoted purely to one topic or technology. Some
chapters may focus on a technology and others may address a set of goals we want to achieve in the
application. We will be switching between technologies and tools as we progress.
WOW! eBook
www.wowebook.org